package com.cskaoyan.com.generic.generic4;

public class Demo2 {
    public static void main(String[] args) {

        User<String> zs = new User<>("zs", "18");
        String age = zs.age;

        User<Integer> zs1 = new User<>("zs", 18);
        Integer age1 = zs1.age;

        System.out.println(age);
        System.out.println(age1);

    }
}

class User<T>{
    String name;
    T age;

    public User(String name, T age) {
        this.name = name;
        this.age = age;
    }
}
